
<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="#">Dashboard</a> <span>&gt;</span> Current Warehouse
		</div>
		<?php
		$label = 'warehouse';
		include 'includes/message.php';
		?>
		<br />
		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">


			<?php
			if($action == ''){
				?>

				<!-- Box -->
				<div class="box" style="width: 1000px">
					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left">
							Current Warehouses
							<h2>
								<!--
						<div class="right">
							<label>search Transaction</label>
							<input type="text" class="field small-field" />
							<input type="submit" class="button" value="search" />
						</div>
						-->
					
					</div>
					<!-- End Box Head -->

					<!-- Table -->
					<div class="table" style="width: 100%">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<th>Date Created:</th>
								<th>Name</th>
								<th>Description</th>
								<th>Region</th>
								<th>City</th>
								<th>Complete Address</th>
								<th width="110" class="ac">Action</th>
							</tr>


							<?php
							if ($totalRecords > 0)
							{
								foreach ($query->result() as $warehouse)
								{
									echo "
											<tr>
												<td>2010-10-10</td>
												<td>".$warehouse->name."</td>
												<td>".$warehouse->description."</td>
												<td>".$warehouse->region."</td>
												<td>".$warehouse->city."</td>
												<td>".$warehouse->address."</td>
												<td><a href='".ADMINBASEURL."warehouse/edit/".$warehouse->id."'  class='ico edit'>edit</a> | <a href='".ADMINBASEURL."warehouse/delete/".$warehouse->id."'  class='ico del'>delete</a></td>
											</tr>";


								}
							}

							?>




						</table>

						<?php
						include 'includes/pagination.php';
						?>

					</div>
					<!-- Table -->

				</div>
				<!-- End Box -->

				<?php
			}else{
				?>

				<!-- Box -->
				<div class="box">
					<!-- Box Head -->
					<div class="box-head">
						<h2>Add New Warehouse</h2>
					</div>
					<!-- End Box Head -->

					<form action="<?php echo ADMINBASEURL."$label/save/"; ?>"
						method="post" onsubmit="return MyForm.validate(this);">

						<!-- Form
Full Name	Username	Email	Usertype	Warehouse	Created By
						-->
						<div class="form">

						<?php
						if($action == 'edit' && isset($warehouse))
						echo "<input type='hidden' name='id'  value='".$warehouse->id."'>";
						?>
							<p>
								<label>Name <span>(Required Field)</span> </label> <input
									type="text" class="field size5" name="name" id="name*"
									alt="Warehouse Name" maxlength="100" style="width: 300px"
									value="<?php echo isset($warehouse)?$warehouse->name:''; ?>" />
							</p>

							<p class="inline-field">
								<label>Region</label> <select class="field size2" name="region"
									style="width: 300px">
									<option value="NCR"
									<?php echo (isset($warehouse) && $warehouse->region =='NCR')?"selected":''; ?>>NCR-
										National Capital Region</option>
									<option value="ARMM"
									<?php echo (isset($warehouse) && $warehouse->region =='ARMM')?"selected":''; ?>>ARMM-
										Autonomous Region of Muslim Mindanao</option>
									<option value="CAR"
									<?php echo (isset($warehouse) && $warehouse->region =='CAR')?"selected":''; ?>>CAR-
										Cordillera Administrative Region</option>
									<option value="I"
									<?php echo (isset($warehouse) && $warehouse->region =='I')?"selected":''; ?>>Region
										1- Ilocos Region</option>
									<option value="II"
									<?php echo (isset($warehouse) && $warehouse->region =='II')?"selected":''; ?>>Region
										2- Cagayan Valley</option>
									<option value="III"
									<?php echo (isset($warehouse) && $warehouse->region =='III')?"selected":''; ?>>Region
										3- Central Luzon</option>
									<option value="IV-A"
									<?php echo (isset($warehouse) && $warehouse->region =='IV')?"selected":''; ?>>Region
										4-A- CALABARZON</option>
									<option value="IV-B"
									<?php echo (isset($warehouse) && $warehouse->region =='V')?"selected":''; ?>>Region
										4-B- MIMAROPA</option>
									<option value="V"
									<?php echo (isset($warehouse) && $warehouse->region =='VI')?"selected":''; ?>>Region
										5- Bicol Region</option>
									<option value="VI"
									<?php echo (isset($warehouse) && $warehouse->region =='VII')?"selected":''; ?>>Region
										6- Western Visayas</option>
									<option value="VII"
									<?php echo (isset($warehouse) && $warehouse->region =='VII')?"selected":''; ?>>Region
										7- Central Visayas</option>
									<option value="VIII"
									<?php echo (isset($warehouse) && $warehouse->region =='VIII')?"selected":''; ?>>Region
										8- Eastern Visayas</option>
									<option value="IX"
									<?php echo (isset($warehouse) && $warehouse->region =='IX')?"selected":''; ?>>>Region
										9- Zamboanga Peninsula</option>
									<option value="X"
									<?php echo (isset($warehouse) && $warehouse->region =='X')?"selected":''; ?>>>Region
										10- Northerm Mindanao</option>
									<option
										value="XI <?php echo (isset($warehouse) && $warehouse->region =='XI')?"selected":''; ?>>">Region
										11- Davao Region</option>
									<option value="XII"
									<?php echo (isset($warehouse) && $warehouse->region =='XII')?"selected":''; ?>>Region
										12- SOCCSKSARGEN</option>
									<option value="XIII"
									<?php echo (isset($warehouse) && $warehouse->region =='XIII')?"selected":''; ?>>Region
										13- Caraga</option>

								</select>
							</p>

							<p>
								<label>City <span>(Required Field)</span> </label> <input
									name="city" id="city*" alt="City" type="text"
									class="field size5" maxlength="100" style="width: 300px"
									value="<?php echo isset($warehouse)?$warehouse->city:''; ?>" />
							</p>

							<p>
								<label>Address <span>(Required Field)</span> </label>
								<textarea name="address" id="address*" alt="Address"
									class="field size3" rows="2" style="width: 90%">
									<?php echo isset($warehouse)?$warehouse->address:''; ?>
								</textarea>
							</p>

							<p>
								<label>Description <span>(Required Field)</span> </label>
								<textarea name="description" id="description*" alt="Description"
									class="field size3" rows="5" style="width: 90%">
									<?php echo isset($warehouse)?$warehouse->description:''; ?>
								</textarea>
							</p>
							<!--								
Name
description
Address
    region
    city
    address
								

								
<div style="float:right">
	display this if the current user is ADMIN
	<select>
		<option value="">WAREHOUSE 1</option>
		<option value="">WAREHOUSE 2</option>
		<option value="">WAREHOUSE 2</option>
		<option value="">WAREHOUSE 3</option>
	</select>
</div>
<br></br>
NAME:<input type="text"/><br>
DESCRIPTION:<textarea></textarea><br>


REGION:

 <select>
	<option value="">I</option>
	<option value="">II</option>
	<option value="">III</option>
	<option value="">IV</option>
	<option value="">V</option>
	<option value="">VI</option>
	<option value="">VII</option>
	<option value="">and so on..</option>
 </select>
 <br>
CITY:<input type="text"/><br>
<br><br>
COMPLETE ADDRESS:
<textarea></textarea>

-->


						</div>
						<!-- End Form -->

						<!-- Form Buttons -->
						<div class="buttons">
							<input type="submit" class="button" value="submit" />
						</div>
						<!-- End Form Buttons -->
					</form>
				</div>
				<!-- End Box -->

				<?php
			}
			?>

			</div>
			<!-- End Content -->

			<!-- Sidebar -->
			<div id="sidebar">


				<!-- End Box -->
			</div>
			<!-- End Sidebar -->

			<div class="cl">&nbsp;</div>
		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->



